import pexpect
import time


def main():
    git_pull = pexpect.spawn("ssh souche@172.17.40.98 ")

    time.sleep(1)  # Cygwin is slow to update process status.
    index= git_pull.expect("(?i) password:")
    print(index)
    git_pull.sendline("12345678")
    index=git_pull.expect("Welcome to Ubuntu 16.04.2 LTS (GNU/Linux 4.4.0-62-generic x86_64)")
    print(index)

if __name__ == '__main__':
    main()

